package com.spzx.product.api.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.spzx.common.core.web.domain.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Data;

import java.util.List;

@Schema(description = "商品规格属性")
@Data
public class ProductSpec extends BaseEntity {

    @Schema(description = "分类id")
    @NotNull(message = "分类id不能为空")
    private Long categoryId;

    @Schema(description = "规格名称")
    @NotEmpty(message = "规格名称不能为空")
    private String specName;

    @Schema(description = "规格值：[{'key':'颜色','valueList':['蓝','白','红']}]")
    @NotEmpty(message = "规格值不能为空")
    @Size(min = 3 ,max = 200 , message = "规格值长度在3到200个字符之间")
    private String specValue;

    @TableField(exist = false)
    @Schema(description = "分类名称")
    private String categoryName;

    @TableField(exist = false)
    @Schema(description = "三级分类id")
    private List<Long> categoryIdList;
}